﻿using System;
using System.Collections.Generic;

using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Text;
using Fjaspx.DB;
using System.Data;

namespace Fjaspx.UI.Web.Admin.Article
{
    public partial class ClassList : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            Response.ContentType = "text/html";
            if (HttpContext.Current.Request["channelId"] != "")
            {
                string strs = Channel_Class_Menu(HttpContext.Current.Request["channelId"]);
                Response.Write(strs);
            }
        }
        #region   频道的文章类别
        public string Channel_Class_Menu(string channelId)
        {
            StringBuilder tempStr = new StringBuilder();
            tempStr.Append("→顶级类别|0");
            DataSet ds = DbHelperSQL.Query("select * from Fjaspx_ArticleCategory where ChannelId='" + channelId + "'");
            if (ds.Tables[0].Rows.Count > 0)
            {
                for (int i = 0; i <= ds.Tables[0].Rows.Count - 1; i++)
                {
                    string tempText = "";
                    string spaceStr = "";
                    tempText = spaceStr + "┝" + ds.Tables[0].Rows[i]["CatName"].ToString();
                    tempStr.Append("," + tempText + "|" + ds.Tables[0].Rows[i]["OrderId"].ToString());
                }
            }
            return tempStr.ToString();
        }
        #endregion
    }
}